<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://struts.apache.org/tags-html"   prefix="html"   %>
<%@ taglib uri="http://struts.apache.org/tags-bean"   prefix="bean"   %>
<%@ taglib uri="http://struts.apache.org/tags-logic"  prefix="logic"  %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<table border="1">
  <tr>
    <th>注文日時</th>
    <th>顧客名</th>
    <th>お届け先住所</th>
    <th>支払い方法</th>
    <th>合計金額</th>
    <th>書籍名</th>
    <th>価格</th>
    <th>注文数</th>
  </tr>

<logic:iterate id="order" name="orders" scope="request">
  <nested:root name="order">
    <nested:size id="rowspan" property="items"/>
       <tr>
         <td rowspan="<%= rowspan %>"><nested:write property="orderDate" format="yyyy-MM-dd H:m:s "/></td>
         <td rowspan="<%= rowspan %>"><nested:write property="customerName" /></td>
         <td rowspan="<%= rowspan %>"><nested:write property="address" /></td>
         <td rowspan="<%= rowspan %>"><nested:write property="paymentString" /></td>
         <td rowspan="<%= rowspan %>" align="right"><nested:write property="sum" format="#,#00"/></td>
      <nested:iterate id="item" property="items" indexId="id">
        <nested:notEqual name="id" value="0"><tr></nested:notEqual>
         <td><bean:write name="item" property="book.title"/></td>
         <td align="right"><bean:write name="item" property="book.price" format="#,#00"/></td>
         <td align="right"><bean:write name="item" property="num"/></td>
       </tr>
    </nested:iterate>
  </nested:root>
</logic:iterate>
</table>
